package com.yjx.managedemo.enums;

import lombok.Getter;

@Getter
public enum IsDeletedFlagEnum {

    DELETED(1,"已删除"),
    UN_DELETED(0,"未删除");

    public int code;
    private String desc;

    IsDeletedFlagEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static IsDeletedFlagEnum getByCode(int code) {
        for (IsDeletedFlagEnum flagEnum : IsDeletedFlagEnum.values()) {
            if (flagEnum.code == code) {
                return flagEnum;
            }
        }
        return null;
    }
}
